<template>
	<view>
		<van-share-sheet v-model="showMore" title="更多操作" :options="options" @select="onSelect" @cancel="toCancel" @click-overlay="toCancel"/>
	</view>
</template>

<script>
	import {Toast} from 'vant';
	export default {
		props: {
			showShare: {
				type: Boolean,
				default: false
			},
			options:{
				type:Array
			}
		},
		watch: {
			showShare(val) {
				this.showMore = val
			}
		},
		data() {
			return {
				options1: [
					{
						name: '结束公文',
						code: 'finish',
						icon: 'static/imgs/icon/finished.png'
					},
					{
						name: '作废',
						code: 'disabled',
						icon: 'static/imgs/icon/disabled.png'
					},
					{
						name: '生成发文字号',
						code: 'generate',
						icon: 'static/imgs/icon/generate.png'
					},
					{
						name: '会签管理',
						code: 'sign',
						icon: 'static/imgs/icon/sign.png'
					},
				],
				showMore: false
			};
		},
		methods: {
			onSelect(option) {
				this.$emit('closeShare', option.operation);
			},
			toCancel(){
				this.$emit('closeShare', '');
			}
		},
	};
</script>

<style>
	/* 修改share-sheet显示的图标大小 */
	/deep/ .van-share-sheet__icon {
	    width: 26px;
		height: 26px;
		margin: 0 30px;
	}
</style>
